Do not output properties when they are undefined because they have been omitted from query#588
Do not output properties when they are undefined because they have been omitted from query#588kapouer wants to merge 4 commits intodresende:masterfrom
Conversation
|
I'm not sure of the rational behind this change. This has come up before. |
|
I wanted to have only/omit query results be serialized without seeing all the columns i've omitted outputed with "null" value. That's the main reason, but as you already know, it could have side effects. If you check the changes i had to make to the test suite, side effects are not that bad ! |
|
Changed the title to better reflect the rationale. |
|
That title is a lot better and I get what you're after now. |
Basically this let us have for the same price
JSON.stringify(john) : {"height": 4}
instead of {"height": 4, "name": null}
Weirdly it wasn't easy to achieve.
This requires dresende/node-sql-query#37 for it to pass tests.
Mind that i tested only postgres (and sqlite ? i don't know) but kept in mind it should work everywhere.